package com.example.demo.vo;

/**
 * @author Just A Fish
 */
public class Result<T> {
    public int code;
    public String msg;
    public T data;

    public Result(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static <T> Result fail(){
        return new Result(0,"ERROR_UNKONW",null);
    }

    public static <T> Result success() {
        return new Result(200, "SUCCESS", null);
    }

    public static <T> Result success(T data) {
        return new Result(200, "SUCCESS", data);
    }
}
